<?php
include 'headers.php';
//print_r($_POST);
$res = $db->select_query('SELECT * FROM modify WHERE id < ' . $_POST['id'] . ' ORDER BY id DESC LIMIT 10');

$countRow = mysql_num_rows($res);
if($countRow != 0)
{
    while($arr = $db->fetch($res))
    {
        $countReply = $db->num_rows('modify_reply', 'reply_id', 'modify_id = ' . $arr['id'] . '');
        ?>     
        <li class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-li-has-count ui-li-has-thumb ui-btn-hover-c" data-theme="c" data-iconpos="right" data-icon="arrow-r" data-wrapperels="div" data-iconshadow="true" data-shadow="false" data-corners="false" data-ctype="modify" id="modify_<?php echo $arr['id']; ?>" last_id="<?php echo $arr['id']; ?>"><div class="ui-btn-inner ui-li"><div class="ui-btn-text">
                    <a class="ui-link-inherit" rel="external" href="?q=modifyDetail&modifyId=<?php echo $arr['id']; ?>">
                        <img class="ui-li-thumb" src="<?php echo $arr['tn_part']; ?>">
                        <h3 class="ui-li-heading"><?php echo $arr['name']; ?></h3>
                        <p class="ui-li-desc"><?php echo $arr['headline']; ?></p>
                        <span class="ui-li-count ui-btn-up-c ui-btn-corner-all"><?php echo $countReply; ?></span>
                    </a> 
                </div><span class="ui-icon ui-icon-arrow-r ui-icon-shadow">&nbsp;</span></div></li>                       
        <?php
    }
}
else
{
    echo '0';
}
?>